var __extends = (this && this.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
        return extendStatics(d, b);
    };
    return function (d, b) {
        if (typeof b !== "function" && b !== null)
            throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
//定义一个数值和字符串的联合类型
var arr;
arr = ['hello', 10];
console.log(arr, "arr");
//定义一个类型断言
var someValue = "this is a string";
//尖括号 断言
var strLength = someValue.length;
console.log(strLength);
//as 类型断言
var strLengths = someValue.length;
console.log(strLengths);
//定义一个 void 实现函数的无返回值
function warnUser() {
    console.log("Hello my friend");
}
//定义一个 never 的函数
// 返回never的函数必须存在无法达到的终点
function error(message) {
    throw new Error(message);
}
// 推断的返回值类型为never
function fail() {
    return error("Something failed");
}
// 返回never的函数必须存在无法达到的终点
function infiniteLoop() {
    while (true) {
    }
}
//在 ts 中定义一个类并实现继承
var Animal = /** @class */ (function () {
    function Animal() {
    }
    Animal.prototype.move = function (distance) {
        if (distance === void 0) { distance = 100; }
        console.log("Hello world ".concat(distance, "\u5206."));
    };
    return Animal;
}());
var Dog = /** @class */ (function (_super) {
    __extends(Dog, _super);
    function Dog() {
        return _super !== null && _super.apply(this, arguments) || this;
    }
    Dog.prototype.bark = function () {
        console.log('Hello world');
    };
    return Dog;
}(Animal));
var dog = new Dog();
dog.move(10);
dog.bark();
//•	2种方式定义一个数组（数组中的元素可以是任意类型）
var list = [1, "123", 3];
console.log(list);
var lists = [1, "123", true];
console.log(lists);
//定义一个求和函数;例Add(2,8,9,6,5,8,7),返回结果45
function Add(a, b, c, d, e, f, g) {
    if (a === void 0) { a = 2; }
    if (b === void 0) { b = 8; }
    if (c === void 0) { c = 9; }
    if (d === void 0) { d = 6; }
    if (e === void 0) { e = 5; }
    if (f === void 0) { f = 8; }
    if (g === void 0) { g = 7; }
    return a + b + c + d + e + f + g;
}
console.log(Add());
//
function f() {
    var a = 10;
    return function g() {
        var b = a * 5;
        return b;
    };
}
var g = f();
console.log(g());
var data = [{
        id: 1,
        geom_xy: "POINT(0 0)",
        geom_z: "0"
    }, {
        id: 2,
        geom_xy: "LINESTRING(1 1,2 2,3 3,)",
        geom_z: "0,1,2,3"
    }, {
        id: 3,
        geom_xy: "POINT(4 4,5 5,6 6,7 7, 8,8)",
        geom_z: "4,5,6,7,8"
    },];
var obj = {
    a: {
        c: {
            w: 2,
            r: {
                q: 4
            }
        },
        d: 1,
        f: 2,
        e: 3
    },
    b: {
        h: 4,
        i: {
            p: {
                q: 5
            }
        }
    }
};
